using Pisces;
using UnityEngine;

public class CameraModule : AbstractMonoModule
{
	private Vector3 m_MoveVelocity;                 
    
	private Vector3 previousFingerPosition;
    
    
	// Start is called before the first frame update
	void Start()
	{
		previousFingerPosition = Input.mousePosition;
	}

	// Update is called once per frame
	void Update()
	{
		mouseMove();
	}

	void mouseMove()
	{
		if (Input.GetMouseButtonDown(0))
		{
			previousFingerPosition = Input.mousePosition;
		}

		if (Input.GetMouseButton(0))
		{
			Vector3 vector3 = transform.position;
			vector3 += (previousFingerPosition - Input.mousePosition).y * 0.1f * Vector3.forward;
			vector3 += (previousFingerPosition - Input.mousePosition).x * 0.1f * Vector3.right;
            
			transform.position = Vector3.SmoothDamp(transform.position, vector3, ref m_MoveVelocity, 0.05f);
		}
        
		previousFingerPosition = Input.mousePosition;
	}
}
